package com.bw.mvp.ui;

import android.os.Bundle;
import android.widget.Toast;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import com.bw.mvp.R;
import com.bw.mvp.base.BaseMvpActivity;
import com.bw.mvp.model.PostListModel;

public class PostActivity extends BaseMvpActivity<PostContract.IPostView,PostPresenter> implements PostContract.IPostView {


    @Override
    public PostPresenter createPresenter() {
        return new PostPresenter();
    }

    @Override
    public int bindLayout() {
        return R.layout.activity_post;
    }

    @Override
    public void initView() {

    }

    @Override
    public void initData() {
        //1:view调用presenter请求数据
        mPresenter.getPostList(1,20);
    }

    @Override
    public void initListener() {

    }
    //4:view接受数据更新UI
    @Override
    public void getPostListSuccess(PostListModel postListModel) {
        Toast.makeText(this,postListModel.getTotal()+"",Toast.LENGTH_SHORT).show();
    }

    @Override
    public void getPostListError() {

    }
}